<template>
  <el-dialog
    :visible="visible"
    width="800px"
    :before-close="handleClose"
    custom-class="listitem-dialog"
    append-to-body
  >
    <slot></slot>
    <span slot="footer" class="dialog-footer">
      <el-button @click="close">关闭</el-button>
    </span>
  </el-dialog>
</template>

<script>
export default {
  name: "ListitemDialog",
  props: {
    visible: {
      type: Boolean,
      required: true
    }
  },
  methods: {
    handleClose() {
      this.$emit('update:visible', false); 
    },
    close() {
      this.$emit('update:visible', false);
    }
  }
};
</script>
